package com.zdy.im.tio;

import org.tio.core.ChannelContext;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author 作者 : zdy
 * @CreateDate 创建时间: 2021-02-30
 */
public class WsOnlineContext {
    private static Map<String, ChannelContext> map = new ConcurrentHashMap<>();

    public static void bindUser(String userId, ChannelContext channelContext) {

        map.put(userId, channelContext);
    }

    public static ChannelContext getChannelContextByUser(String userId){
        return map.get(userId);
    }
}
